import request from '@/utils/httpRequest'

// 主播分页查询
export function getAnchorList(val) {
  return request({
    url: '/live/anchor',
    method: 'get',
    params: val || {}
  })
}

// 主播添加
export function addAnchor(val, headers = {}) {
  return request({
    url: '/live/anchor',
    method: 'post',
    data: val || {},
    headers
  })
}

// 主播状态修改
export function UpdataAnchor(val, headers = {}) {
  return request({
    url: '/live/anchor',
    method: 'put',
    data: val || {},
    headers
  })
}

// 主播详情
export function getAnchorDetail(val) {
  return request({
    url: '/live/anchor/'+val,
    method: 'get'
  })
}

// 主播删除
export function deleteAnchor(val, headers = {}) {
  return request({
    url: '/live/anchor/'+val,
    method: 'delete',
    headers
  })
}

// 模块分页查询
export function getRecommendList(val) {
  return request({
    url: '/live/recommend',
    method: 'get',
    params: val || {}
  })
}

// 模块添加
export function addRecommend(val) {
  return request({
    url: '/live/recommend',
    method: 'post',
    data: val || {}
  })
}

// 模块修改
export function UpdataRecommend(id, val) {
  return request({
    url: '/live/recommend/'+id,
    method: 'put',
    data: val || {}
  })
}

// 模块详情
export function getRecommendDetail(val) {
  return request({
    url: '/live/recommend/'+val,
    method: 'get'
  })
}

// 模块删除
export function deleteRecommend(val) {
  return request({
    url: '/live/recommend/'+val,
    method: 'delete'
  })
}

// 修改在线人数
export function updateAudience(val) {
  return request({
    url: '/live/anchor',
    method: 'put',
    data: val || {}
  })
}
